<template>
  <MenuBar></MenuBar>
  <div class="top"></div>
  <h2 class="ta-center">$route.params:</h2>
  <el-form ref="formRef" label-width="120px">
    <el-form-item v-for="(value, key) in params" :key="key" :label="key">
      <el-input :placeholder="value + ''"></el-input>
    </el-form-item>
  </el-form>
  <div class="ta-center">
    <el-button @click="testStore.$state.counter++">
      @/stores/test: {{ testStore.$state.counter }}
    </el-button>
  </div>
</template>
<script setup>
import testStore from "@/stores/test";
import axios from "axios";
import { ElMessage } from "element-plus";
import { useRoute } from "vue-router";
let { params } = useRoute();
const { data } = await axios.get("/api/test/" + params.bravo);
ElMessage({
  duration: 5000,
  showClose: true,
  message: "从服务器收到的data：" + JSON.stringify(data, null, "\t"),
});
</script>
<style lang="sass" scoped>
.top
  margin-top: 60px
.ta-center
  text-align: center
</style>
